package com.fyales.android.api.http;

import android.app.Application;

/**
 * @author fyales
 * @since 15/11/9.
 * <p>Retrofit配置类
 */
public class Config {

    private String version;  //api version
    private String apiHost;
    private String cookie;
    private Application application;
    private static Config instance;

    public Application getApplication() {
        return application;
    }

    public void setApplication(Application application) {
        this.application = application;
    }

    public static Config getInstance(Application application) {
        if (instance == null) {
            synchronized (Config.class) {
                if (instance == null)
                    instance = new Config(application);
            }
        }
        return instance;
    }

    private Config(Application application) {
        this.application = application;
    }

    public String getApiHost() {
        return apiHost;
    }

    public void setApiHost(String apiHost) {
        this.apiHost = apiHost;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String cookie) {
        this.version = cookie;
    }

    public String getCookie() {
        return cookie;
    }

    public void setCookie(String cookie) {
        this.cookie = cookie;
    }
}
